#include "kona-qrd.dtsi"
#include "kona-iot-rb5-audio.dtsi"
#include "camera/kona-camera-sensor-rb5.dtsi"

&qupv3_se12_2uart {
	status = "okay";
};

&qupv3_se1_i2c {
	status = "disabled";
};

&qupv3_se6_4uart {
	status = "ok";
};

&pm8150l_gpios {
	lt9611_rst_pin_out {
		lt9611_rst_pin_out_default: lt9611_rst_pin_out_default {
		pins = "gpio5";
		function = "normal";
		output-enable;
		input-disable;
		bias-pull-down;
		power-source = <0>;
		};
	};
};

&mdss_mdp {
	connectors = <&sde_dp &sde_dsi &sde_dsi1 &sde_rscc>;
};

&mdss_dsi0_pll {
	/delete-property/ qcom,dsi-pll-ssc-en;
};

&mdss_dsi1_pll {
	/delete-property/ qcom,dsi-pll-ssc-en;
};

&lt9611_pins {
	mux {
		pins = "gpio63";
		function = "gpio";
	};

	config {
		pins = "gpio63";
		drive-strength = <8>;
		bias-disable = <0>;
	};
};

&qupv3_se5_i2c {
	status = "ok";
	lt9611: lt,lt9611@2b {
		compatible = "lt,lt9611uxc";
		reg = <0x2b>;
		interrupt-parent = <&tlmm>;
		interrupts = <63 0>;
		interrupt-names = "lt_irq";
		lt,irq-gpio = <&tlmm 63 0x0>;
		lt,reset-gpio = <&pm8150l_gpios 5 0x0>;
		instance_id = <0>;
		lt,non-pluggable;

		pinctrl-names = "default";
		pinctrl-0 = <&lt9611_pins &lt9611_rst_pin_out_default>;

		lt,preferred-mode = "1920x1080";

		totalVoltage-supply = <&pm8150a_l11>;
		lt,supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;

			lt,supply-entry@0 {
				reg = <0>;
				lt,supply-name = "totalVoltage";
				lt,supply-min-voltage = <3300000>;
				lt,supply-max-voltage = <3300000>;
				lt,supply-enable-load = <200000>;
				lt,supply-post-on-sleep = <50>;
			};
		};

		lt,customize-modes {
			lt,customize-mode-id@0 {
				lt,mode-h-active = <1920>;
				lt,mode-h-front-porch = <88>;
				lt,mode-h-pulse-width = <44>;
				lt,mode-h-back-porch = <148>;
				lt,mode-h-active-high;
				lt,mode-v-active = <1080>;
				lt,mode-v-front-porch = <4>;
				lt,mode-v-pulse-width = <5>;
				lt,mode-v-back-porch = <36>;
				lt,mode-v-active-high;
				lt,mode-refresh-rate = <60>;
				lt,mode-clock-in-khz = <148500>;
			};

			lt,customize-mode-id@1 {
				lt,mode-h-active = <3840>;
				lt,mode-h-front-porch = <176>;
				lt,mode-h-pulse-width = <88>;
				lt,mode-h-back-porch = <400>;
				lt,mode-h-active-high;
				lt,mode-v-active = <2160>;
				lt,mode-v-front-porch = <8>;
				lt,mode-v-pulse-width = <10>;
				lt,mode-v-back-porch = <72>;
				lt,mode-v-active-high;
				lt,mode-refresh-rate = <60>;
				lt,mode-clock-in-khz = <608040>;
			};
		};

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				lt9611_in_0: endpoint {
					remote-endpoint = <&ext_dsi_0_out>;
				};
			};

			port@1 {
				reg = <1>;
				lt9611_in_1: endpoint {
					remote-endpoint = <&ext_dsi_1_out>;
				};
			};

		};
	};
};

&sde_dsi {
	qcom,dsi-default-panel = <&dsi_ext_bridge_1080p>;

	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		port@0 {
			reg = <0>;
			ext_dsi_0_out: endpoint {
				remote-endpoint = <&lt9611_in_0>;
			};
		};
	};
};

&sde_dsi1 {
	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		port@1 {
			reg = <1>;
			ext_dsi_1_out: endpoint {
				remote-endpoint = <&lt9611_in_1>;
			};
		};
	};
};

&usb1 {
	/delete-property/ qcom,default-mode-none;
	dwc3@a800000 {
		dr_mode = "host";
	};
};

&soc {
	clk40M: can_clock {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <40000000>;
	};
};

&usb0 {
	qcom,charging-disabled;
};

&usb2_phy0 {
	qcom,param-override-seq = <0x43 0x70>;
};

&pm8150b_charger {
	qcom,batteryless-platform;
	qcom,lpd-disable;
};

&qupv3_se0_spi {
	status = "okay";
	can@0 {
		compatible = "microchip,mcp2517fd";
		reg = <0>;
		clocks = <&clk40M>;
		interrupt-parent = <&tlmm>;
		interrupts = <15 0>;
		interrupt-names = "can_irq";
		spi-max-frequency = <10000000>;
		gpio-controller;
		status = "okay";
	};
};

&pcie1 {
	status = "disabled";
};

&thermal_zones {
	/delete-node/ modem-lte-sub6-pa1;
	/delete-node/ modem-lte-sub6-pa2;
	/delete-node/ modem-mmw0-usr;
	/delete-node/ modem-mmw1-usr;
	/delete-node/ modem-mmw2-usr;
	/delete-node/ modem-mmw3-usr;
	/delete-node/ modem-skin-usr;
	/delete-node/ modem-wifi-usr;
	/delete-node/ modem-ambient-usr;
	/delete-node/ modem-0-usr;
	/delete-node/ modem-1-usr;
	/delete-node/ modem-streamer-usr;
	/delete-node/ modem-mmw0-mod-usr;
	/delete-node/ modem-mmw1-mod-usr;
	/delete-node/ modem-mmw2-mod-usr;
	/delete-node/ modem-mmw3-mod-usr;

	/delete-node/ skin-therm-usr;
	/delete-node/ skin-therm-step;
	/delete-node/ camera-therm-usr;

	/delete-node/ mmw-pa1-usr;
	/delete-node/ mmw-pa1-step;
	/delete-node/ mmw-pa2-usr;
	/delete-node/ mmw-pa2-step;
	/delete-node/ xo-therm-step;
	/delete-node/ xo-therm-usr;
	/delete-node/ skin-msm-therm-step;

	pm8250-wifi-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150_adc_tm ADC_AMUX_THM2_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <52000>;
				hysteresis = <4000>;
				type = "passive";
			};
		};
	};

	pm8150l-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150l_adc_tm ADC_AMUX_THM3_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <50000>;
				hysteresis = <4000>;
				type = "passive";
			};
		};
	};

	pm8250-xo-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150_adc_tm ADC_XO_THERM_PU2>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <50000>;
				hysteresis = <4000>;
				type = "passive";
			};

		};
	};

	pm8150l-skin-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150l_adc_tm ADC_AMUX_THM2_PU2>;
		wake-capable-sensor;
		trips {
			skin_trip: skin-config0 {
				temperature = <50000>;
				hysteresis = <48000>;
				type = "passive";
			};
		};

		cooling-maps {
			lcd_cdev {
				trip = <&skin_trip>;
				cooling-device = <&mdss_mdp 153 153>;
			};
		};
	};
};
